<template>
	<web-view :src="url"></web-view>
</template>

<script setup>
import { onMounted,onUnmounted,ref } from 'vue'
const url = ref('/static/ceshi.html');
onMounted(()=>{
	window.addEventListener('message', receiveMessage, false);
})

const receiveMessage = (res) => {
	console.log(res);
	url.value = 'http://www.baidu.com';
}

onUnmounted(()=>{
	// 清理监听器
	window.removeEventListener('message', receiveMessage);
})
</script>

<style>
</style>